<template>
  <div> 
    我的订单 {{ userInfo.address }}
  </div>
</template>

<script>
  export default {
    data() {
      return {
        userInfo: {}
      }
    },
    middleware({store, redirect}) {
      store.commit('getToken')
      let token = store.state.token
      if (!token) {
        redirect('/login')
      }
    },
    async asyncData({ $axios }) {
      let res = await $axios.get('/api/member/getInfo')
      return {
        userInfo: res.data.data.data
      }
    }
  }
</script>
